package com.booza.dao;

import java.util.Collection;

import com.booza.model.Financials;

/**
 * DAO level interface for Financials table.
 */
public interface FinancialsDAO
{
	/**
	 * Find financials by primary key.
	 * 
	 * @param id
	 *          - PK
	 * @return matching financials row
	 */
	Financials findFinancialsById(Integer id);

	/**
	 * Insert the current transaction details.
	 * 
	 * @param transaction
	 */
	void insertFinancials(Financials transaction);

	/**
	 * Find the list of all transactions of the given user.
	 * 
	 * @param accountId
	 *          - user id
	 * @return Return the matching transactions.
	 */
	Collection<Financials> findTransactionsForUser(Integer accountId);

	/**
	 * Updates the financials row.
	 * 
	 * @param transaction
	 */
	void updateFinancials(Financials transaction);

	/**
	 * Fetches list of all transactions in pending state
	 * 
	 * @return Return collection of pending transactions.
	 */
	Collection<Financials> findPendingTransactions();
	
	/**
	 * Fetches list of all debit transactions in pending state
	 * 
	 * @return Return collection of pending transactions.
	 */
	Collection<Financials> findPendingDebitTransactions();
}
